from setuptools import setup, find_packages
import py2exe, os, glob, sys

excludeList = ['PyShell', 'dl', 'dotblas', 'hexdump', 'mx', 'win32com.gen_py',
	"pywin", "pywin.debugger", "pywin.debugger.dbgcon",
	"pywin.dialogs", "pywin.dialogs.list",
	"Tkconstants", "Tkinter", "tcl", "tcl84", "tk84", "qt-mt3", 
	]
iconFiles = os.path.join("../../icons","*.*")
itkconfigureFiles = os.path.join("../../../config/itkConfiguration", "*.*")
dataFiles = [
	("icons",glob.glob(iconFiles)),
	("Configuration", glob.glob(itkconfigureFiles)),
]

def removeWinFiles():
	"""
	Removes unneeded dll's from Windows/System32 directory
	"""
	path = os.curdir
	path = os.path.join(path,"dist")
	removes = ["AVICAP32.dll", "AVIFIL32.dll", "MSACM32.dll", "MSVFW32.dll"]
	for filename in removes:
		rmfile = os.path.join(path,filename)
		os.remove(rmfile)

#wrap_itk_prefix = "C:\\Python25\\Lib\\site-packages\\itk" 

#swig_modules = [ x for x in os.listdir(os.path.join(wrap_itk_prefix, "lib")) if not x.startswith("_")] 
#swig_modules = [os.path.splitext(x)[0] for x in swig_modules] 

#sys.path.append(os.path.join(wrap_itk_prefix, "lib")) 

setup(name="YUKI",
   windows=[{"script":"yuki.py",
   #console=[{"script":"yuki.py",
			 "icon_resources": [(1, "../../icons/yammi_star.ico")]
			 } ],
   data_files = dataFiles,
   options = {"py2exe":
			 { "excludes": excludeList,
			   "includes": ['jolly'],
			  }},
   )
#sys.path.pop() 


